<?php if (!defined('THINK_PATH')) exit(); /*a:6:{s:69:"E:\www\paobanglang\nav/../application/admin\view\express\setting.html";i:1510213911;s:63:"E:\www\paobanglang\nav/../application/admin\view\Main\menu.html";i:1514443605;s:67:"E:\www\paobanglang\nav/../application/admin\view\Public\header.html";i:1512184095;s:65:"E:\www\paobanglang\nav/../application/admin\view\public\city.html";i:1512292211;s:70:"E:\www\paobanglang\nav/../application/admin\view\Main\menu_footer.html";i:1510984673;s:67:"E:\www\paobanglang\nav/../application/admin\view\Public\footer.html";i:1516863870;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>后台管理</title>
   
    <link rel="stylesheet" href="__STATIC__/admin/css/amazeui.min.css" />
    <link rel="stylesheet" href="__STATIC__/admin/css/admin.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/style.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/pintuer.css">
    <link rel="stylesheet" href="__STATIC__/admin/css/app.css">
    <script src="__STATIC__/admin/js/jquery.min.js"></script>
    <script src="__STATIC__/admin/js/amazeui.min.js"></script>
    <script src="__STATIC__/admin/js/pintuer.js"></script>
    <script src="__STATIC__/admin/js/app.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/layer/layer.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/laydate/laydate.js"></script>
    <script type="text/javascript" src="__STATIC__/admin/laytpl/laytpl.js"></script>
</head>
<body>
<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-topbar-brand">
        <a href="javascript:;" class="tpl-logo">
            <img src="__STATIC__/admin/images/logo.png">
        </a>
    </div>
    <div class="am-icon-list tpl-header-nav-hover-ico am-fl am-margin-right"></div>
    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>
    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">
        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list tpl-header-list">
            <!--<li title="清除缓存">
                <a href="javascript:clear_cache()" class="tpl-header-list-link">
                    清除缓存
                </a>
            </li>-->
            <li title="注销登录">
                <a href="<?php echo url('admin/login/quit'); ?>" class="tpl-header-list-link">
                    <span class="am-icon-sign-out tpl-header-list-ico-out-size"></span>
                </a>
            </li>
        </ul>
    </div>
</header>
<div class="tpl-page-container tpl-page-header-fixed">
    <div class="tpl-left-nav tpl-left-nav-hover" style="margin-left: -10px">
        <div class="tpl-left-nav-title">
            导航列表
        </div>
        <div class="tpl-left-nav-list">
            <ul class="tpl-left-nav-menu">
                <?php foreach($menu_list as $menu): ?>
                    <li class="tpl-left-nav-item">
                        <?php 
                            $b = 0;
                            foreach($menu['child'] as $k => $v){
                                if (strtolower(request()->controller().'/'.request()->action()) == $v['url']){
                                    $b = 1;
                                    break;
                                }
                            }
                           //dump($menu['child']);
                         ?>
                        <a class="nav-link tpl-left-nav-link-list" <?php if($b == 1): ?> class="active" <?php endif; ?>>
                            <i class="<?php echo $menu['icon']; ?>"></i>
                            <span><?php echo $menu['name']; ?></span>
                            <?php if(count($menu['child']) > 0): ?>
                                <i class="am-icon-angle-right tpl-left-nav-more-ico am-fr am-margin-right tpl-left-nav-more-ico-rotate"></i>
                            <?php endif; ?>
                        </a>
                        <?php if(count($menu['child']) > 0): ?>
                            <ul class="tpl-left-nav-sub-menu" style="display:<?php if($b != 1): ?>none<?php else: ?>block<?php endif; ?>;">
                                <li>
                                    <?php foreach($menu['child'] as $menu_child): ?>
                                        <a href="__ROOT__/admin/<?php echo $menu_child['url']; ?>" id="<?php echo request()->controller(); ?>/<?php echo request()->action(); ?>" <?php if(strtolower(request()->controller().'/'.request()->action()) == $menu_child['url']): ?> class="active"<?php endif; ?>>
                                            <i class="am-icon-angle-right"></i>
                                            <span><?php echo $menu_child['name']; ?></span>
                                            <!--<i class="am-icon-star tpl-left-nav-content-ico am-fr am-margin-right"></i>-->
                                        </a>
                                    <?php endforeach; ?>
                                </li>
                            </ul>
                        <?php endif; ?>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</div>

<style>
    .am-dropdown{
        width: 100%;
        padding-left: 30px;
        margin-bottom: 10px;
    }
    .am-dropdown div{
        color: #000;
    }
</style>
<div class="tpl-content-wrapper">
<form method="post" class="form-x" action="?tab=upload&pid=<?php echo input('get.pid'); ?>&cid=<?php echo input('get.cid'); ?>&aid=<?php echo input('get.aid'); ?>" style="background: #ffffff">
    <br>
    <script>
        //city canshu
        var pid="<?php echo input('get.pid'); ?>";
        var cid="<?php echo input('get.cid'); ?>";
        var aid="<?php echo input('get.aid'); ?>";
        var selectc=true;
        var selecta=true;
        function select_p(){
            return false;
        }
        function select_c(){
            return false;
        }
        function select_a(){
            location.href="?pid="+pid+"&cid="+cid+"&aid="+aid;
        }
    </script>
    <div class="am-dropdown">
        <div class="label">
            <label><?php echo lang('currency')['city']; ?></label>
        </div>
        <div class="field">
            <?php if(input('session.type') == 'province' || input('session.type') == 'all'): ?>
<select id="province" onchange="pchange(this.value)" name="pid" class="input input-auto" >
	<option value="">请选择</option>
</select>
<?php endif; if(input('session.type') == 'province' ||  input('session.type') == 'city' || input('session.type') == 'all'): ?>
<select id="city" onchange="cchange(this.value)" name="cid" class="input input-auto hidden" >
	<option value="">请选择</option>
</select>
<?php endif; ?>
<select id="area" onchange="achange(this.value)" name="aid" class="input input-auto hidden" >
	<option value="">请选择</option>
</select>
<script id="province_list_tpl" type="text/html">
	{{# for(var i = 0, len = d.data.length; i < len; i++){ }}
	<option {{# if(d.data[i].id==pid){ }}selected{{#}}} value="{{ d.data[i].id }}">{{ d.data[i].name }}</option>
	{{# } }}
</script>
<script id="city_list_tpl" type="text/html">
	{{# for(var i = 0, len = d.data.length; i < len; i++){ }}
	<option {{# if(d.data[i].id==cid){ }}selected{{#}}} value="{{ d.data[i].id }}">{{ d.data[i].name }}</option>
	{{# } }}
</script>
<script id="area_list_tpl" type="text/html">
	{{# for(var i = 0, len = d.data.length; i < len; i++){ }}
	<option {{# if(d.data[i].id==aid){ }}selected{{#}}} value="{{ d.data[i].id }}">{{ d.data[i].name }}</option>
	{{# } }}
</script>
<script>
    var func = false;
    $('select').click(function(){
        func = true;
    });
    if(selectc) {
        $('[name=cid]').removeClass('hidden');
    }
    if(selecta){
        $('[name=aid]').removeClass('hidden');
    }
    if('<?php echo input("session.type"); ?>' === 'province' || '<?php echo input("session.type"); ?>' === 'all') {
        $.getJSON('__ROOT__/admin/city/ajax_get?type=province', {}, function (res) {
            var tpl = $("#province_list_tpl").html();
            laytpl(tpl).render(res, function (render) {
                $("#province").html('<option value="">请选择</option>' + render);
            });
            if (pid != '' && pid != 0) {
                $('[name=pid]').change();
            }
        });
    }else if('<?php echo input("session.type"); ?>' === 'city'){
        val = '<?php echo input("session.aid"); ?>';
        if(selectc){
            $.getJSON('__ROOT__/admin/city/ajax_get?type=city&id='+val, {}, function(res){
                var tpl = $("#city_list_tpl").html();
                laytpl(tpl).render(res, function(render){
                    $("#city").html('<option value="">请选择</option>' + render);
                    $("#city").val(cid);
                    $("#city").change();
                });
            });
        }
    }else if('<?php echo input("session.type"); ?>' === 'area'){
        val = '<?php echo input("session.aid"); ?>';
//        if(selecta && aid){
            $.getJSON('__ROOT__/admin/city/ajax_get?type=area&nofather=ok&id='+val, {}, function(res){
                var tpl = $("#area_list_tpl").html();
                laytpl(tpl).render(res, function(render){
                    $("#area").html('<option value="">请选择</option>'+render);
                });
            });
//        }
    }
    function pchange(val) {
        pid = val;
        if(selectc){
            $.getJSON('__ROOT__/admin/city/ajax_get?type=city&id='+pid, {}, function(res){
                var tpl = $("#city_list_tpl").html();
                laytpl(tpl).render(res, function(render){
                    $("#city").html('<option value="">请选择</option>'+render);
                });
                if(selectc === true){
                    if(cid !== '' && cid !== 0){
                        $('[name=cid]').change();
                    }
                }
            });
        }
        if(func){
            select_p();
        }
    }
    function cchange(val) {
        cid = val;
        if(selecta && cid){
            $.getJSON('__ROOT__/admin/city/ajax_get?type=area&id='+cid, {}, function(res){
                var tpl = $("#area_list_tpl").html();
                laytpl(tpl).render(res, function(render){
                    $("#area").html('<option value="">请选择</option>'+render);
                });
            });
        }
        if(func){
            select_c();
        }
    }
    function achange(val) {
        aid = val;
        $('[name=aid]').removeClass('hidden');
        if(func){
            select_a();
        }
    }
</script>
        </div>
    </div>
    <?php if(count($data) > 0): ?>
        <div class="am-dropdown">
            <div class="label">
                <label>配送员图标</label>
            </div>
            <div class="field">
                <img src="<?php echo $data['express_icon']; ?>" width="100" style="min-height: 50px">
                <input type="hidden" readonly name="express_icon" id="express_icon" value="<?php echo $data['express_icon']; ?>">
                <span class="addbtn"><button type="button" data-id="express_icon" class="button upload">更改图标</button></span>
                <label>
                    <input type="checkbox" <?php if($data['icon_status'] == 1): ?>checked="checked"<?php endif; ?>" value="1" name="icon_status">
                    启用
                </label>
            </div>
        </div>
        <!--<div class="am-dropdown">
            <div class="label">
                <label>用户完成订单奖励积分</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="reward_integral" name="reward_integral" value="<?php if(!$data['reward_integral']): ?>1<?php else: ?><?php echo $data['reward_integral']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 积分
            </div>
        </div>-->
        <div class="am-dropdown">
            <div class="label">
                <label>跑客接单范围</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="scope" name="scope" value="<?php if(!$data['scope']): ?>3.00<?php else: ?><?php echo $data['scope']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> km
            </div>
        </div>
        <div class="am-dropdown">
            <div class="label">
                <label>基础跑腿费</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="basics_charge" name="basics_charge" value="<?php if(!$data['basics_charge']): ?>3.00<?php else: ?><?php echo $data['basics_charge']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 元
            </div>
        </div>
        <div class="am-dropdown">
            <div class="label">
                <label>应急加收跑腿费</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="anxious_charge" name="anxious_charge" value="<?php if(!$data['anxious_charge']): ?>3.00<?php else: ?><?php echo $data['anxious_charge']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 元
            </div>
        </div>
        <div class="am-dropdown">
            <div class="label">
                <label>闪送加收跑腿费</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="fast_charge" name="fast_charge" value="<?php if(!$data['fast_charge']): ?>3.00<?php else: ?><?php echo $data['fast_charge']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 元
            </div>
    </div>
        <div class="am-dropdown">
            <div class="label">
                <label>每公里跑腿费-白天</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="white_charge" name="white_charge" value="<?php if(!$data['white_charge']): ?>3.00<?php else: ?><?php echo $data['white_charge']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 元
            </div>
        </div>
        <div class="am-dropdown">
            <div class="label">
                <label>每公里跑腿费-夜晚</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="night_charge" name="night_charge" value="<?php if(!$data['night_charge']): ?>3.00<?php else: ?><?php echo $data['night_charge']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 元
            </div>
        </div>
        <div class="am-dropdown">
            <div class="label">
                <label>每公斤增加跑腿费</label>
            </div>
            <div class="field">
                <input type="text" class="input input-auto" id="weight_charge" name="weight_charge" value="<?php if(!$data['weight_charge']): ?>3.00<?php else: ?><?php echo $data['weight_charge']; endif; ?>" size="10" placeholder="<?php echo lang('currency')['required']; ?>" data-validate="required:<?php echo lang('currency')['required']; ?>"/> 元
            </div>
        </div>
        <div class="am-dropdown">
            <button class="button bg-main" type="submit">提交</button>
        </div>
    <?php else: ?>
        <div style="margin-left: 40px;">请选择城市后设置</div>
		<br>
    <?php endif; ?>
</form>
</div>
<script src="__STATIC__/admin/js/jquery.min.js"></script>
<script src="__STATIC__/admin/js/amazeui.min.js"></script>
<script src="__STATIC__/admin/js/pintuer.js"></script>
<script src="__STATIC__/admin/js/app.js"></script>
<script type="text/javascript" src="__STATIC__/admin/layer/layer.js"></script>
<script type="text/javascript" src="__STATIC__/admin/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__STATIC__/admin/laydate/laydate.js"></script>
<script type="text/javascript" src="__STATIC__/admin/laytpl/laytpl.js"></script>
<script>
    $('.upload').on('click',function (){
            var id = $(this).attr('data-id');
            upload(id);
        }
    );
    function upload(id){
        layer.open({
            type:2,
            title:false,
            area: ['70%', '90%'],
            offset: '5%',
            content: "<?php echo url('/admin/material'); ?>?id="+id
        });
    }
</script>
<?php if(request()->isPost()): ?>
<script>
    layer.msg('操作完成！');
    setTimeout(function (){
        parent.window.location.href = parent.window.location.href;
    },800);
</script>
<?php endif; ?>
</body>
</html>